CREATE TABLE [dbo].[TRSIST_GRUP]
(
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_GRUP] [dbo].[TD_VC_008] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TRSIST_GR__CO_US__04AFB25B] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TRSIST_GR__FE_US__05A3D694] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TRSIST_GR__CO_US__0697FACD] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TRSIST_GR__FE_US__078C1F06] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TRSIST_GRUP] ADD CONSTRAINT [PK__TRSIST_G__BBFA885930E33A54] PRIMARY KEY CLUSTERED  ([CO_SIST], [CO_GRUP]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TRSIST_GRUP] ADD CONSTRAINT [FK__TRSIST_GR__CO_GR__4979DDF4] FOREIGN KEY ([CO_GRUP]) REFERENCES [dbo].[TMGRUP_USUA] ([CO_GRUP])
GO
ALTER TABLE [dbo].[TRSIST_GRUP] ADD CONSTRAINT [FK__TRSIST_GR__CO_SI__4885B9BB] FOREIGN KEY ([CO_SIST]) REFERENCES [dbo].[TMSIST] ([CO_SIST])
GO
GRANT SELECT ON  [dbo].[TRSIST_GRUP] TO [public]
GRANT INSERT ON  [dbo].[TRSIST_GRUP] TO [public]
GRANT DELETE ON  [dbo].[TRSIST_GRUP] TO [public]
GRANT UPDATE ON  [dbo].[TRSIST_GRUP] TO [public]
GO
